<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="../plugins/elementui/index.css">
    <script src="../js/vue.js"></script>
    <script src="../plugins/elementui/index.js"></script>
</head>
<body>
<div id="app">
    <el-table :data="tableData" style="width: 100%">
        <el-table-column prop="date" label="日期" width="180"></el-table-column>
        <el-table-column prop="name" label="姓名" width="180"></el-table-column>
        <el-table-column prop="address" label="地址"></el-table-column>
    </el-table>
<!--  size-change: 页面大小发生变化时调用 handleSizeChange
      current-change: 当前页码变化时调用 handleCurrentChange
      current-page: 当前页码
      page-sizes: 每页大小的下拉选择框
      page-size: 页面大小 page-size会值必须在page-sizes存在
      layout: 定义页面显示哪些分页信息
        total: 显示总记录数
        sizes: 显示每页大小的下拉选择框
        prev: 上一页
        pager: 页码
        next: 下一页
        jumper: 通过输入页码跳转


-->
    <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="currentPage4"
            :page-sizes="[10, 20, 30, 40]"
            :page-size="10"
            layout="total, prev, pager, next, jumper"
            :total="total">
    </el-pagination>
</div>

<script>
    var vue = new Vue({
        el: "#app",
        data() {
            return {
                total:100,
                currentPage4: 1,
                tableData: [{
                    date: '2016-05-02',
                    name: '王小虎',
                    address: '上海市普陀区金沙江路 1518 弄'
                }, {
                    date: '2016-05-04',
                    name: '王小虎',
                    address: '上海市普陀区金沙江路 1517 弄'
                }, {
                    date: '2016-05-01',
                    name: '王小虎',
                    address: '上海市普陀区金沙江路 1519 弄'
                }, {
                    date: '2016-05-03',
                    name: '王小虎',
                    address: '上海市普陀区金沙江路 1516 弄'
                }]
            }
        },
        methods: {
            handleSizeChange(val) {
                console.log(`每页 ${val} 条`);
            },
            handleCurrentChange(val) {
                console.log(`当前页: ${val}`);
            }
        }
    });
</script>
</body>
</html>